/*
 * @Descripttion: |
 * @version: 1.0
 * @Author: 王娆
 * @Date: 2020-08-23 19:15:10
 * @LastEditors: 王娆
 * @LastEditTime: 2020-08-24 00:37:02
 */
 const filterRouters=(allRoutes,userInfo) => {
    let res = allRoutes.filter(item=>{
        return item.meta.author.indexOf(userInfo) !== -1
    })
    res.length && res.filter(item=>{
        if(item.children){
            item.children = filterRouters(item.children,userInfo)
        }
    })
    return res
}

export default filterRouters